package com.mi.rof.entity.enums;

import java.util.HashMap;
import java.util.Map;

/**
 * @author zwq
 */
public enum RepairOrderEnum {
    // 正常工单状态
    NORMAL_ORDER(0,"工单正常"),
    // 工单已撤回
    ORDER_WITHDRAWN(8,"工单已撤回"),
    // 工单结束
    ORDER_DELETED(9, "工单已删除");

    private int code;

    private String msg;

    RepairOrderEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }



    public String getMsg() {
        return msg;
    }


    /**
     * 通过code获取枚举类
     */
    private static Map<Integer,RepairOrderEnum > stateMap = new HashMap<>();
    static {
        for (RepairOrderEnum value : RepairOrderEnum.values()) {
            stateMap.put(value.getCode(),value);
        }
    }
    public static RepairOrderEnum getByCode(Integer code){
        return stateMap.get(code);
    }
}
